/**
 * 用于修复获取uniapp上不兼容的一些问题
 */

import { getCurrentInstance, Ref, ref } from '@vue/composition-api';

export const useDomRef = <T extends abstract new (...args: any) => any>(refName: string) => {
  const current = getCurrentInstance();
  console.log('useDomRef', current?.refs);

  return ref(current?.refs[refName]) as Ref<InstanceType<T>>;
};
